package com.lframework.xingyun.basedata.vo.product.speccost;

import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import com.lframework.starter.web.core.vo.BaseVo;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModelProperty;
import com.lframework.starter.web.core.components.validation.TypeMismatch;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.util.List;

import lombok.Data;

@Data
public class ProductSpecCostDetailVo implements BaseVo, Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主商品id
     */
    @ApiModelProperty(value = "主商品id", required = true)
    @NotBlank(message = "请输入主商品id！")
    @Length(message = "主商品id最多允许32个字符！")
    private String mainProductId;

    /**
     * 属性id
     */
    @ApiModelProperty(value = "属性id", required = true)
    @NotBlank(message = "请输入属性id！")
    @Length(message = "属性id最多允许32个字符！")
    private String propertyId;

    /**
     * 属系值id
     */
    @ApiModelProperty(value = "属系值id", required = true)
    @NotBlank(message = "请输入属系值id！")
    @Length(message = "属系值id最多允许32个字符！")
    private String itemId;

    /**
     * 源成分商品ID
     */
    @ApiModelProperty(value = "源成分商品ID", required = true)
    @NotBlank(message = "请输入源成分商品ID！")
    @Length(message = "源成分商品ID最多允许32个字符！")
    private String sourceProductId;

    /**
     * 成分商品ID
     */
    @ApiModelProperty(value = "成分商品ID", required = true)
    @NotBlank(message = "请输入成分商品ID！")
    @Length(message = "成分商品ID最多允许32个字符！")
    private String productId;

    /**
     * 消耗单位ID
     */
    @ApiModelProperty(value = "消耗单位ID", required = true)
    @NotBlank(message = "请输入消耗单位ID！")
    private String unitId;

    /**
     * 消耗数量
     */
    @ApiModelProperty(value = "消耗数量", required = true)
    @NotNull(message = "请输入消耗数量！")
    @TypeMismatch(message = "消耗数量格式有误！")
    private Integer consumeQuantity;

    /**
     * 类型 0=主成分 1=替换品
     */
    @ApiModelProperty(value = "类型 0=主成分 1=替换品", required = true)
    @NotNull(message = "请输入类型 0=主成分 1=替换品！")
    @TypeMismatch(message = "类型 0=主成分 1=替换品格式有误！")
    private Integer type;

    /**
     * 单位成本
     */
    @ApiModelProperty(value = "单位成本", required = true)
    @NotNull(message = "请输入单位成本！")
    @TypeMismatch(message = "单位成本格式有误！")
    @IsNumberPrecision(message = "单位成本最多允许6位小数！", value = 6)
    private BigDecimal unitCost;

    /**
     * 总成本
     */
    @ApiModelProperty(value = "总成本", required = true)
    @NotNull(message = "请输入总成本！")
    @TypeMismatch(message = "总成本格式有误！")
    @IsNumberPrecision(message = "总成本最多允许6位小数！", value = 6)
    private BigDecimal totalCost;

    /**
     * 替换品详情
     */
    @ApiModelProperty(value = "替换品详情")
    private List<ProductSpecCostDetailVo> replacements;

}

